#include "tj_form_drugquery.h"
#include "ui_tj_form_drugquery.h"
#include "windows.h"
#include "commctrl.h"
#include <QFont>
#include <QDebug>
#include <QSettings>
#include <QMessageBox>
#include <QLibrary>
#include <QString>
#include <QFile>
#include <QDateTime>
#include "pub_var.h"

FormDrugQuery::FormDrugQuery(QWidget *parent)
    : QWidget(parent),
     ui(new Ui::FormDrugQuery)
{
    ui->setupUi(this);

    QSettings setIni("clin.ini", QSettings::IniFormat);
    QRect rct = setIni.value("windowState/gsize").toRect();
    this->setGeometry(rct);
    ui->statusbar->hide();
    ui->tbDetail->setVisible(false);
    ui->horizontalLayout_6->setStretch(0,1);
    ui->horizontalLayout_6->setStretch(1,0);
    ui->pushButton->setEnabled(true);
    ui->cbBalanced->setVisible(false);
    this->showNormal();

    qr = QSqlQuery(pub::db_o);
    qr0 = QSqlQuery(pub::db_o);

    QDateTime dt;

    ui->dtStart->setDate(dt.currentDateTime().date());
    ui->dtEnd->setDate(dt.currentDateTime().date());

    //ui->rbSingleDay->setChecked(true);
    ui->dtEnd->setEnabled(false);

    ui->lb_dept->setText(pub::dp_name);
}

FormDrugQuery::~FormDrugQuery()
{
    delete ui;
}

void FormDrugQuery::on_pushButton_clicked()
{

    bool need_check = false;
    sq = " select receive_date from com_events "
         " where "
         " event_id = 'valid_date_check'"
         " and event_user = '%1'"
         " and user_dept = '%2'";
    sq = sq.arg(pub::usr_code)
            .arg(pub::dp_code);

    qr.exec(sq);

    if(!qr.next())
    {
        sq = " insert into com_events "
             " (event_id, event_user, user_dept, receive_date) "
             " values"
             " ('valid_date_check','%1', '%2', sysdate)";
        sq = sq.arg(pub::usr_code)
                .arg(pub::dp_code);

        qr.exec(sq);

        need_check = true;
    }
    else
    {
        QDate cur_date = QDate::currentDate();
        QDate check_date = qr.value(0).toDate();

        if(cur_date != check_date)
        {
            sq = " update com_events set "
                 " receive_date = sysdate "
                 " where "
                 " event_id = 'valid_date_check'"
                 " and event_user = '%1'"
                 " and user_dept = '%2'";
            sq = sq.arg(pub::usr_code)
                    .arg(pub::dp_code);

            qr.exec(sq);

            need_check = true;
        }

    }

    if(ui->ckb_valid_date->isChecked() || need_check)
    {
        check_valid_date();
    }

    ui->pushButton->setEnabled(false);
    ui->pushButton_2->setEnabled(false);
    qApp->processEvents();  //刷新界面显示
    QString sqSelect, sqWhere, sqFrom, dt1, dt2, cfSql;

    if(ui->dtStart->dateTime().date() >ui->dtEnd->dateTime().date()){
        QMessageBox::information(NULL, "注意","起始日期不能大于终止日期！");
        ui->pushButton->setEnabled(true);
        return;
    }

    dt1 = ui->dtStart->dateTime().toString("yyyy/MM/dd");
    dt2 = ui->dtEnd->dateTime().toString("yyyy/MM/dd");

    ui->pushButton->setEnabled(false);

    if(ui->rbSingle->isChecked()){
        if(ui->leSingle->text().isEmpty()){
            QMessageBox::information(NULL, "注意","指定单品种查询模式，但未指定具体品种名称！");
            ui->pushButton->setEnabled(true);
            return;
        }

        if(ui->cbSingleDay->isChecked())
        {
            sq = "select f.card_no 病志号,f.name 姓名,f.reg_date 挂号时间,p.apply_date 处方时间,p.trade_name 药名,"
                 "p.specs 规格,p.pack_unit 单位,p.out_num/p.pack_qty 数量,p.get_person"
                 " from pha_com_output p , fin_opr_register f where p.drug_dept_code = '"
                 + pub::dp_code + "' and p.drug_code = '"
                 + ui->leSingle->text() + "' and trunc(p.apply_date) = to_date('"
                 + dt1 + "','yyyy/mm/dd') and p.get_person = f.clinic_code and f.trans_type = '1' order by p.apply_date";


            int w = ui->tbId->width();
            md.setQuery(sq, pub::db_o);
            ui->tbId->setModel(&md);
            pub::setColumnWidth(ui->tbId, "0.12^0.1^0.15^0.15^0.15^0.1^0.05^0.05", w, 10);

            ui->pushButton_2->setEnabled(true);
        }
        else
        {
            sq = "select to_char(back_date,'yyyy-mm-dd') 日期, drug_name 品名, specs 规格,pack_unit 单位, "
                 "num_remain 日截止, num_consume 日消耗 ";
            sq = sq + "from sun_drug_backup_daily where trunc(back_date) >=to_date('";
            sq = sq + dt1 + "','yyyy/mm/dd') and trunc(back_date) <= to_date('";
            sq = sq + dt2 + "','yyyy/mm/dd') ";
            sq = sq + " and drug_code = '"+ui->leSingle->text() +"' order by back_date";


            int w = ui->tbId->width();
            md.setQuery(sq, pub::db_o);
            ui->tbId->setModel(&md);
            pub::setColumnWidth(ui->tbId, "0.15^0.3^0.15^0.1^0.1^0.1", w, 10);

            ui->pushButton_2->setEnabled(true);
        }
        ui->pushButton->setEnabled(true);
        return;
    }

    dt1 = ui->dtStart->dateTime().toString("yyyy/MM/dd");
    dt2 = ui->dtEnd->dateTime().toString("yyyy/MM/dd");

    sqFrom  = " FROM PHA_COM_STOCKINFO a, PHA_COM_BASEINFO b, drug_base_info c ";

    if(ui->rbKc->isChecked() )
    {
        //柜号,品名,规格,单位,有效期,库存数量,整件数量,零头数量, 挂账
        sqSelect = "SELECT c.position, b.TRADE_NAME, b.SPECS, b.PACK_UNIT, to_char(a.VALID_DATE,'yyyy-mm-dd'), (a.STORE_SUM / a.pack_qty) , nvl(c.recal, 0),"
             "CASE WHEN c.package_num = 0 THEN 0 ELSE floor((a.STORE_SUM / a.pack_qty - nvl(c.recal, 0))/ c.package_num) END,"
             "CASE WHEN c.package_num = 0 THEN (a.STORE_SUM / a.pack_qty - nvl(c.recal, 0)) ELSE mod(a.STORE_SUM / a.pack_qty - nvl(c.recal, 0),  c.package_num) END";
     }
    else if(ui->rbKcxh->isChecked())
    {
        sqSelect = "SELECT c.position, b.TRADE_NAME, b.SPECS, b.PACK_UNIT, to_char(a.VALID_DATE,'yyyy-mm-dd'), (a.STORE_SUM / a.pack_qty - nvl(c.recal, 0)),"
             "CASE WHEN c.package_num = 0 THEN 0 ELSE floor((a.STORE_SUM / a.pack_qty - nvl(c.recal, 0))/ c.package_num) END,"
             "CASE WHEN c.package_num = 0 THEN (a.STORE_SUM / a.pack_qty - nvl(c.recal, 0)) ELSE mod(a.STORE_SUM / a.pack_qty - nvl(c.recal, 0),  c.package_num) END";
        sqSelect = sqSelect + ",(select sum(out_num/pack_qty) from PHA_COM_OUTPUT d where trunc(oper_date) >=to_date('";
        sqSelect = sqSelect + dt1 + "','yyyy/mm/dd') and trunc(oper_date) <= to_date('";
        sqSelect = sqSelect + dt2 + "','yyyy/mm/dd') ";
        sqSelect = sqSelect + " and d.drug_code = a.drug_code and drug_dept_code='"
                              + pub::dp_code + "')";

    }
    else if(ui->rbCftj->isChecked())
    {
        //处方统计
        qr0.exec("delete from sun_recipe_count");    //清除旧数据
        cfSql = "select '皮肤科中药口服' lb,count(distinct o.recipe_no) ct,to_char(o.oper_date, 'yyyy-mm-dd') dt "
                " from pha_com_output o, drug_base_info b where o.drug_code = b.drug_code  and "
                " trunc(oper_date) >=to_date('" + dt1 + "','yyyy/mm/dd')  and trunc(oper_date) <= to_date('"
                + dt2 + "','yyyy/mm/dd') and department = '皮肤' and useage = '口服' and  medicine_type = 'Z' "
                "group by to_char(o.oper_date, 'yyyy-mm-dd')  "
                "  union  "
                " select '皮肤科其它' lb,count(distinct o.recipe_no) ct,to_char(o.oper_date, 'yyyy-mm-dd') dt "
                " from pha_com_output o, drug_base_info b where o.drug_code = b.drug_code and o.recipe_no in"
                " (  ( select distinct o.recipe_no from pha_com_output o, drug_base_info b"
                "  where o.drug_code = b.drug_code  and trunc(oper_date) >=to_date('" + dt1 + "','yyyy/mm/dd')  "
                " and trunc(oper_date) <= to_date('" + dt2 + "','yyyy/mm/dd') "
                " and department = '皮肤' and o.out_num > 0)"
                "    minus "
                "    (select  distinct o.recipe_no from pha_com_output o, drug_base_info b "
                "     where o.drug_code = b.drug_code and trunc(oper_date) >=to_date('" + dt1 + "','yyyy/mm/dd')"
                "  and trunc(oper_date) <= to_date('" + dt2 + "','yyyy/mm/dd')"
                "  and department = '皮肤' and useage = '口服' and  medicine_type = 'Z') )"
                "  group by to_char(o.oper_date, 'yyyy-mm-dd')   "
                " union  "
                " select '骨科' lb, count(distinct o.recipe_no) ct,to_char(o.oper_date, 'yyyy-mm-dd') dt "
                " from pha_com_output o, drug_base_info b"
                " where o.drug_code = b.drug_code  and trunc(oper_date) >=to_date('" + dt1 + "','yyyy/mm/dd') "
                " and trunc(oper_date) <= to_date('" + dt2 + "','yyyy/mm/dd') "
                " and department = '骨科' group by to_char(o.oper_date, 'yyyy-mm-dd') "
                " order by dt ";
        if(!qr.exec(cfSql)){
            qDebug()<<cfSql;
        }
qDebug()<<cfSql;
        int pz,pq,gs;
        pz = 0;
        pq = 0;
        gs = 0;
        QString dt,odt,lb;
        while(qr.next())
        {

            dt = qr.value(2).toString();
            lb = qr.value(0).toString();
            if(odt.isEmpty())
            {
                odt = dt;
            }

            if(dt != odt )
            {
                qr0.exec("insert into sun_recipe_count (dt, pz, pq, gs)"
                         " values ('" + odt + "',"
                         + QString::number(pz) + ","
                         + QString::number(pq) + ","
                         + QString::number(gs) + ") ");
                pz = 0;
                pq = 0;
                gs = 0;
                odt = dt;
                qDebug()<<qr0.lastQuery();
            }

            if(lb =="皮肤科中药口服" )
            {
                pz = qr.value(1).toInt();
            }
            else if(lb =="皮肤科其它" )
            {
                pq = qr.value(1).toInt();
            }
            else if(lb =="骨科" )
            {
                gs = qr.value(1).toInt();
            }
            qDebug()<<dt<<lb<<pz<<pq<<gs;
        }

        qr0.exec("insert into sun_recipe_count (dt, pz, pq, gs)"
                 " values ('" + dt + "',"
                 + QString::number(pz) + ","
                 + QString::number(pq) + ","
                 + QString::number(gs) + ") ");
        qDebug()<<qr0.lastQuery();

        qr0.exec("select sum(pz),sum(pq),sum(gs) from sun_recipe_count");
        qr0.next();
        pz = qr0.value(0).toInt();
        pq = qr0.value(1).toInt();
        gs = qr0.value(2).toInt();
        qr0.exec("insert into sun_recipe_count (dt, pz, pq, gs)"
                 " values ('合计',"
                 + QString::number(pz) + ","
                 + QString::number(pq) + ","
                 + QString::number(gs) + ") ");

        qDebug()<<qr0.lastQuery();
        cfSql = "select dt, pz, pq, gs, pz + pq + gs from sun_recipe_count order by dt ";
    }
    sqWhere = " where a.DRUG_CODE = c.DRUG_CODE and a.DRUG_CODE = b.DRUG_CODE "
              " and (a.STORE_SUM  / a.pack_qty ) > 0 "
              //" and (a.STORE_SUM  / a.pack_qty ) > nvl(c.recal, 0)"
              " and c.valid = '1' AND DRUG_DEPT_CODE = '"
              + pub::dp_code + "'";

    if(ui->rbCurrentDay->isChecked())
    {
        sqWhere = sqWhere + " and a.drug_code in (select DISTINCT DRUG_CODE from PHA_COM_APPLYOUT ";
        //where trunc(apply_date) = trunc(sysdate)) ";
        sqWhere = sqWhere + " where trunc(apply_date) >=to_date('";
        sqWhere = sqWhere + dt1 + "','yyyy/mm/dd') and trunc(apply_date) <= to_date('";
        sqWhere = sqWhere + dt2 + "','yyyy/mm/dd')) ";
    }

    if(ui->rbSelfMade->isChecked())
    { //
        sqWhere = sqWhere + " and c.come_from='制剂'";

    }
//    if(ui->rbSingle->isChecked()){ // no need more strict condition
//        sqWhere = sqWhere + " and c.drug_code='"+ui->leSingle->text()+"'";
//    }
    if(ui->rbAll->isChecked())
    {
        // no need more strict condition
        ;
    }
    sqWhere = sqWhere + " ORDER BY c.position";

    sq = sqSelect + sqFrom + sqWhere;


    qDebug()<<sq;

    if(ui->rbCftj->isChecked())
    {
        md.setQuery(cfSql, pub::db_o);
    }
    else
    {
        md.setQuery(sq, pub::db_o);
    }

    if(ui->rbKc->isChecked())
    {
        //storage
        //柜号,品名,规格,单位,有效期,库存数量,整件数量,零头数量
        md.setHeaderData(0, Qt::Horizontal, "柜号");
        md.setHeaderData(1, Qt::Horizontal, "品名");
        md.setHeaderData(2, Qt::Horizontal, "规格");
        md.setHeaderData(3, Qt::Horizontal, "单位");
        md.setHeaderData(4, Qt::Horizontal, "有效期");
        md.setHeaderData(5, Qt::Horizontal, "库存");
        md.setHeaderData(6, Qt::Horizontal, "挂账");
        md.setHeaderData(7, Qt::Horizontal, "件数");
        md.setHeaderData(8, Qt::Horizontal, "零数");

        ui->tbId->setModel(&md);
        pub::setColumnWidth(ui->tbId, "0.08^0.2^0.12^0.08^0.12^0.08^0.08^0.08^0.08", ui->tbId->width(), 10);

    }
    else if(ui->rbKcxh->isChecked())
    {
        md.setHeaderData(0, Qt::Horizontal, "柜号");
        md.setHeaderData(1, Qt::Horizontal, "品名");
        md.setHeaderData(2, Qt::Horizontal, "规格");
        md.setHeaderData(3, Qt::Horizontal, "单位");
        md.setHeaderData(4, Qt::Horizontal, "有效期");
        md.setHeaderData(5, Qt::Horizontal, "库存");
        md.setHeaderData(6, Qt::Horizontal, "件数");
        md.setHeaderData(7, Qt::Horizontal, "零数");
        md.setHeaderData(8, Qt::Horizontal, "消耗");

        ui->tbId->setModel(&md);
        pub::setColumnWidth(ui->tbId, "0.08^0.2^0.12^0.08^0.12^0.08^0.08^0.08^0.08", ui->tbId->width(), 10);

    }
    else if(ui->rbCftj->isChecked())
    {
        md.setHeaderData(0, Qt::Horizontal, "日期");
        md.setHeaderData(1, Qt::Horizontal, "皮肤中药");
        md.setHeaderData(2, Qt::Horizontal, "皮肤其它");
        md.setHeaderData(3, Qt::Horizontal, "骨科");
        md.setHeaderData(4, Qt::Horizontal, "合计");


        ui->tbId->setModel(&md);
        pub::setColumnWidth(ui->tbId, "0.18^0.18^0.18^0.18^0.18", ui->tbId->width(), 10);

    }
    ui->pushButton->setEnabled(true);
    ui->pushButton_2->setEnabled(true);

}

void FormDrugQuery::on_pushButton_2_clicked()
{
    close();

}

void FormDrugQuery::on_rbSingle_clicked()
{
    ui->groupBox_3->setEnabled(false);
    ui->gbDate->setEnabled(true);
    ui->cbSingleDay->setChecked(true);
    ui->dtEnd->setEnabled(true);
    ui->pushButton->setEnabled(true);
    ui->tbDetail->setVisible(false);
    ui->horizontalLayout_6->setStretch(0,1);
    ui->horizontalLayout_6->setStretch(1,0);
    ui->cbBalanced->setVisible(false);

    sq = "SELECT position 柜号, drug_name 品名, specs 规格, drug_code 药品编码 "
         " from drug_base_info order by position ";

    md.setQuery(sq, pub::db_o);
    ui->tbId->setModel(&md);
    pub::setColumnWidth(ui->tbId, "0.1^0.3^0.15^0.2", ui->tbId->width(), 5);

}

void FormDrugQuery::on_tbId_doubleClicked(const QModelIndex &index)
{
    if(!ui->rbSingle->isChecked()){
        return;
    }
    QString str;
    str = index.siblingAtColumn(3).data(0).toString();
    ui->leSingle->setText(str);

}

void FormDrugQuery::on_dtStart_dateChanged(const QDate &date)
{
    if(ui->cbSingleDay->isChecked()){
        ui->dtEnd->setDate(date);
    }
}

void FormDrugQuery::on_cbSingleDay_clicked()
{
    if(ui->cbSingleDay->isChecked()){
        ui->dtEnd->setEnabled(false);
    }else{
        ui->dtEnd->setEnabled(true);
    }

}

void FormDrugQuery::on_rbCurrentDay_clicked()
{
    setState();
}

void FormDrugQuery::on_rbSelfMade_clicked()
{
    setState();
}

void FormDrugQuery::on_rbAll_clicked()
{
    setState();
}

//void FormDrugQuery::on_ckConsume_clicked()
//{
//    setState();
//}

void FormDrugQuery::setState()
{
    ui->gbDate->setEnabled(false);//预置状态
    ui->rbKc->setEnabled(false);
    ui->rbKcxh->setEnabled(false);
    ui->groupBox->setEnabled(true);
    ui->groupBox_3->setEnabled(true);
    ui->tbDetail->setVisible(false);
    ui->horizontalLayout_6->setStretch(0,1);
    ui->horizontalLayout_6->setStretch(1,0);
    ui->pushButton->setEnabled(true);
    ui->cbBalanced->setVisible(false);
    ui->leSingle->clear();


    if(ui->rbCurrentDay->isChecked()){
        ui->gbDate->setEnabled(true);
        ui->cbSingleDay->setChecked(true);
        ui->dtEnd->setEnabled(false);
        ui->rbKc->setEnabled(true);
        ui->rbKcxh->setEnabled(true);
    }else if(ui->rbSelfMade->isChecked() || ui->rbAll->isChecked()){
        ui->rbKc->setEnabled(true);
        ui->rbKcxh->setEnabled(true);

    }else if(ui->rbSingle->isChecked()){
        ui->rbKc->setEnabled(false);
        ui->rbKcxh->setEnabled(false);
        return;
    }

    if(ui->rbKcxh->isChecked() || ui->rbCftj->isChecked()){
        ui->gbDate->setEnabled(true);
    }
    if(ui->rbCftj->isChecked()){
        ui->groupBox->setEnabled(false);
        ui->gbDate->setEnabled(true);
        ui->dtStart->setEnabled(true);
        ui->dtEnd->setEnabled(true);
    }
}

void FormDrugQuery::closeEvent(QCloseEvent *event)
{
    Q_UNUSED(event);
    QSettings setIni("clin.ini", QSettings::IniFormat);
    setIni.setValue("windowState/gsize", QVariant(this->geometry()));
    emit destroyW( "formDrugQuery" );
}

void FormDrugQuery::on_rbKc_clicked()
{
    setState();
}
void FormDrugQuery::on_rbKcxh_clicked()
{
    setState();
}
void FormDrugQuery::on_rbCftj_clicked()
{
    setState();
}

void FormDrugQuery::on_rbHang_clicked()
{
    ui->groupBox_3->setEnabled(false);
    ui->gbDate->setEnabled(true);
    ui->cbSingleDay->setChecked(false);
    ui->dtEnd->setEnabled(true);

    ui->tbDetail->setVisible(true);
    ui->horizontalLayout_6->setStretch(0,2);
    ui->horizontalLayout_6->setStretch(1,3);
    ui->pushButton->setEnabled(false);
    ui->cbBalanced->setVisible(true);

    sq = "SELECT position 柜号, drug_name 品名,specs 规格,nvl(recal, 0) 数量, drug_code from drug_base_info ";
    if(ui->cbBalanced->isChecked()){
        sq += " where nvl(recal, 0) <> 0 order by position ";
    }else{
        sq += " where valid = '1' order by position ";
    }

    md.setQuery(sq, pub::db_o);

    //int a = this->font().pointSize();
    int w = ui->tbId->width() - 50;
    ui->tbId->setModel(&md);
    pub::setColumnWidth(ui->tbId, "0.15^0.45^0.25^0.15^", w, 5);

}

void FormDrugQuery::on_tbId_clicked(const QModelIndex &index)
{
    if(!ui->rbHang->isChecked()){
        return;
    }
    QString drug_code;
    drug_code = index.siblingAtColumn(4).data(0).toString();

    QString tmpCondition = "";
    if(ui->cbBalanced->isChecked()){
//        tmpCondition = " and oper_date > (select nvl(max(oper_date), to_date('2000/1/1','yyyy/mm/dd')) "
//                       " from drug_sub_account where balanced = '1' and drug_code = '" + drug_code + "')";
        tmpCondition = " and balanced = '0' ";
    }

    sq = "select to_char(oper_date, 'yyyy-mm-dd') 日期, oper_sum 数量, oper_name 操作员,  "
         " (case when in_way is null then out_way else in_way end) 变更方式, "
         " (case when leader is not null then concat(concat( leader,'，'), memo) else memo end) 备注 , item_io_id from drug_sub_account "
         "where oper_sum <> 0 and drug_code = '" + drug_code + "' " + tmpCondition + "order by oper_date ";

    mdRecal.setQuery(sq, pub::db_o);

    int w = ui->tbDetail->width() - 50;

    ui->tbDetail->setModel(&mdRecal);
    pub::setColumnWidth(ui->tbId, "0.2^0.1^0.1^0.15^0.45", w, 6);

}

void FormDrugQuery::on_cbBalanced_clicked()
{

    on_rbHang_clicked();
    mdRecal.setQuery("", pub::db_o);
    //on_tbId_clicked( ui->tbId->currentIndex());
}

void FormDrugQuery::on_tbDetail_doubleClicked(const QModelIndex &index)
{

    if(ui->rbHang->isChecked()){
        //
        return;
    }

    sq = "select drug_name,oper_sum, leader, memo from drug_sub_account where item_io_id = '"
            + index.siblingAtColumn(5).data(0).toString() + "'";

    if(!qr.exec(sq)){
        QMessageBox::warning(this,"注意","查询sql执行失败！");
        return;
    }
    qr.next();
    QString str = qr.value(3).toString();
    str.append("\n");

    while(true){
        str.append(qr.value(0).toString());
        str.append("\t");
        str.append(qr.value(1).toString());
        if(!qr.next()){
            break;
        }
        str.append("\n");
    }
    QMessageBox::warning(this,"明细", str);
}

void FormDrugQuery::check_valid_date()
{

    qDebug()<<"药品效期筛查。。。";
    sq = "select trade_name, specs, batch_no, valid_date"
         " from pha_com_storage "
         " where  drug_dept_code = '%1' "
         " and store_sum > 0 "
         " and valid_date < sysdate + 90"
         " order by valid_date";
    sq = sq.arg(pub::dp_code);

    qDebug()<<"sql is : "<<sq;

    if(!qr0.exec(sq))
    {
        QMessageBox::information(this, "注意", "效期筛查sql执行失败！");
        return;
    }

    QString msg = "";

    while(qr0.next())
    {
        msg += qr0.value("trade_name").toString() + "/";
        msg += qr0.value("specs").toString() + "/";
        msg += qr0.value("batch_no").toString() + "/";
        msg += qr0.value("valid_date").toDate().toString("yyyy-MM-dd") + "\n";
    }

    if(!msg.isEmpty())
    {
        QMessageBox::information(this, "临期药品筛查", msg);
    }

    qDebug()<<"\n";
}
